const path = require('path')
const resolve = dir => path.join(__dirname, dir)

module.exports = {
    chainWebpack: config => {
        // 设置快捷路径
        config.resolve.alias
        .set('@', resolve('src'))
    },
    // 代理 
	devServer: {
		proxy: {
			'/api': {
				target: 'http://localhost:82',
				ws: true,
				changeOrigin: true,
				secure: false,
				pathRewrite: {
					'^/api': '' // 路径重写
				}
			},
        },
    }
}
